home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr49
/
strpp300.zip
/
FILESTR.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-11
|
1KB
|
59 lines
/* -------------------------------------------------------------------- */
/* String++ Version 3.00 04/10/93 */
/* */
/* Enhanced string class for Turbo C++/Borland C++. */
/* Copyright 1991-1993 by Carl W. Moreland */
/* */
/* filestr.cpp */
/* -------------------------------------------------------------------- */
#include "filestr.h"
FileString::FileString(const char* PathName)
{
String tmp = PathName;
Process(tmp);
}
FileString::FileString(const String& PathName)
{
Process(PathName);
}
void FileString::Process(const String& PathName)
{
int n;
n = PathName.FindLast("\\");
Path = PathName.SubStr(0, n+1);
FileName = PathName.SubStr(n+1, PathName.Len()-n-1);
n = FileName.FindLast(".");
if(n != -1)
{
Name = FileName.SubStr(0, n);
Ext = FileName.SubStr(n+1, FileName.Len()-n-1);
}
else
Name = FileName;
if(Path[1] == ':')
{
Drive = Path.SubStr(0,2);
Path.Delete(0,2);
}
}
void FileString::operator=(const char* PathName)
{
String tmp = PathName;
Process(tmp);
}
void FileString::operator=(const string& PathName)
{
Process(PathName);
}